﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using System.Data;
using CustomsSystem.BLL;
using CustomsSystem.Model;

namespace WEB.feetype
{
    public partial class Chancefee : System.Web.UI.Page
    {
        Info_feeType FT = new Info_feeType();
        FeeTypeManage FM = new FeeTypeManage();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Request.QueryString["feetypeno"] != "")
                {
                    string feeno = Request.QueryString["feetypeno"].ToString();
                    Label1.Text = feeno;
                    TextBox1.Text = FM.GetModel(feeno).feeName;
                }
            }
        }

        protected void Button1_Click(object sender, EventArgs e)
        {

            if (TextBox1.Text != "")
            {
                FT.feeTypeNo = Label1.Text;
                FT.feeName = TextBox1.Text;
                if (rbn1.Checked == true)
                { FT.feeType = 0; }
                else FT.feeType = 1;
                FM.Update(FT);
                Response.Write("<script>alert('修改成功')</script>");
                Response.Redirect("index_fee.aspx");
            }
            else
                Response.Write("<script>alert('请输入名称')</script>");

        }

        protected void Button2_Click(object sender, EventArgs e)
        {
            Response.Redirect("Index_fee.aspx");
        }
    }
}